﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="/jstl/cout" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 
<%@ page import="com.infodms.dms.common.Constant"%>
<%
	String contextPath = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<jsp:include page="${contextPath}/common/jsp_head_new.jsp" />
<title>密码维护</title>
<script type="text/javascript">
	function confirmAdd() {
		var newPass = document.getElementById("newPassword");
		var checkNewPass = document.getElementById("checkNewPassword");
		
		if(document.getElementById("passId").value == ""){
			if(newPass.value == ""){
				MyAlert("请输入新密码");			
			}else if(checkNewPass.value == ""){
				MyAlert("请重复输入新密码");
			}else if(newPass.value != checkNewPass.value){
				MyAlert("两次密码输入不一致，请重新输入");
			}else {
				fm.action="<%=contextPath%>/sysusermng/sysuserinfo/SysPasswordManager/modefyPasswordInfo.do";
				fm.submit(); 
			}	
		}else {
			if(document.getElementById("nowPassword").value == ""){
				MyAlert("请输入原密码");
			}else if(newPass.value == ""){
				MyAlert("请输入新密码");			
			}else if(checkNewPass.value == ""){
				MyAlert("请重复输入新密码");
			}else if(newPass.value != checkNewPass.value){
				MyAlert("两次密码输入不一致，请重新输入");
			}else {
				fm.action="<%=contextPath%>/sysusermng/sysuserinfo/SysPasswordManager/modefyPasswordInfo.do";
				fm.submit(); 
			}	
		}
	}
</script>
</head>
<body>
<div class="navigation"><img src="<%=contextPath%>/img/nav.gif" />&nbsp;当前位置： 个人信息管理  &gt; 个人信息管理   &gt; 密码修改</div>
	<form id="fm" name="fm" method="post">
	<input type="hidden" name="curPage" id="curPage" value="1" />
	<input id="userId" name="userId" type="hidden" value="${user.userId}"/>
	<input id="passId" name="passId" type="hidden" value="${user.password}"/>	
		<table class="table_query" border="0">
			<c:if test="${checkMessage != null && checkMessage != ''}">
				<tr>
			  		<td colspan="2" style="text-align: center;">&nbsp;<font color="red">*&nbsp;注意：【${checkMessage}】</font>&nbsp;</td>
				</tr>
			</c:if>
			<tr>
		 		<td style="width: 50%;text-align: right;">&nbsp;用户名：&nbsp;</td>
		  		<td style="width: 50%;text-align: left;">&nbsp;${user.acnt}&nbsp;</td>
			</tr>
			<tr>
		 		<td style="width: 50%;text-align: right;">&nbsp;原密码：&nbsp;</td>
		  		<td style="width: 50%;text-align: left;">
		  			<input class="middle_txt" type="password" id="nowPassword" name="nowPassword"/>
		  			<font color="red">&nbsp;*&nbsp;(第一次设定密码此项可不填写)</font>
		  		</td>
			</tr>
			<tr>
				<td style="width: 50%;text-align: right;">&nbsp;新密码：&nbsp;</td>
		  		<td style="width: 50%;text-align: left;">
		  			<input class="middle_txt" type="password" id=newPassword name="newPassword"/>
		  		</td>
		  	</tr>
			<tr>		  		
		  		<td style="width: 50%;text-align: right;">&nbsp;再输一遍：&nbsp;</td>
				<td style="width: 50%;text-align: left;">
					<input class="middle_txt" type="password" id=checkNewPassword name="checkNewPassword"/>
				</td>
			</tr>
			<tr>
				<td colspan="2" style="text-align: center;">
					<input class="normal_btn" type="button" value="确定"  onclick="confirmAdd();"/>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>